import java.io.*;
import java.util.*;

public class Benchmarks
{
	public static void main(String[] args)
	{
		if(args.length != 1)
		{
			System.err.println("Usage `java Benchmarks NUM`");
			return;
		}

		Random r = new Random();
		int n = Integer.parseInt(args[0]);
		BufferedWriter out = null;

		try {
			out = new BufferedWriter(new FileWriter("benchmarks/" + n + ".txt"));
		} catch(Exception e) {
			System.err.println("open file faied");
		}

		try {
			out.write(n + "\n");
			for(int i=0; i<n; ++i)
				out.write(r.nextDouble() + "\n");

			for(int i=0; i<n; ++i)
			{
				for(int j=0; j<n; ++j)
				{
					if( i == j )
					{
						out.write(0 + " ");
					}
					else
					{
						out.write((r.nextInt(99)+1) + " ");
					}
				}
				out.write("\n");
			}
		} catch(Exception e) {
			System.err.println("Filed to write...");
		} finally {
			try {
				out.close();
			} catch(Exception e)
			{ }
		}
	}
}

